/*
 Navicat Premium Data Transfer

 Source Server         : lmc
 Source Server Type    : MySQL
 Source Server Version : 80022
 Source Host           : localhost:3306
 Source Schema         : db_e

 Target Server Type    : MySQL
 Target Server Version : 80022
 File Encoding         : 65001

 Date: 21/03/2023 23:04:11
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for order_detail
-- ----------------------------
DROP TABLE IF EXISTS `order_detail`;
CREATE TABLE `order_detail` (
  `id` bigint NOT NULL COMMENT '主键',
  `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '名字',
  `order_id` bigint NOT NULL COMMENT '订单id',
  `number` int NOT NULL DEFAULT '1' COMMENT '数量',
  `amount` decimal(10,2) NOT NULL COMMENT '金额',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='订单明细表';

-- ----------------------------
-- Table structure for orders
-- ----------------------------
DROP TABLE IF EXISTS `orders`;
CREATE TABLE `orders` (
  `id` bigint NOT NULL COMMENT '主键',
  `number` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '订单号',
  `status` int NOT NULL DEFAULT '1' COMMENT '订单状态 1待付款，2待派送，3已派送，4已完成，5已退款',
  `user_id` bigint NOT NULL COMMENT '下单用户',
  `address_book_id` bigint NOT NULL COMMENT '地址id',
  `order_time` datetime NOT NULL COMMENT '下单时间',
  `amount` decimal(10,2) NOT NULL COMMENT '实收金额',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='订单表';

-- ----------------------------
-- Records of orders
-- ----------------------------
BEGIN;
INSERT INTO `orders` VALUES (12435465767, '2', 1, 147563212344, 2133527862112, '2023-03-21 13:58:29', 12.00);
COMMIT;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(20) COLLATE utf8_bin DEFAULT NULL COMMENT '姓名',
  `age` int DEFAULT NULL COMMENT '年龄',
  `gender` char(1) COLLATE utf8_bin DEFAULT NULL COMMENT '性别',
  `phone` varchar(100) COLLATE utf8_bin DEFAULT NULL COMMENT '手机号',
  `bank_id` varchar(30) COLLATE utf8_bin DEFAULT NULL COMMENT '银行卡',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=147563212345 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='用户表';

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` VALUES (4, '赵六', 20, '男', '19912341234', '41302512341234123');
INSERT INTO `user` VALUES (5, '初七', 20, '男', '19912341234', '41302512341234123');
INSERT INTO `user` VALUES (6, '张无极', 20, '女', '19912341234', NULL);
INSERT INTO `user` VALUES (7, '张无极', 20, '女', '19912341234', NULL);
INSERT INTO `user` VALUES (8, '张无极', 20, '女', '19912341234', NULL);
INSERT INTO `user` VALUES (9, '张无极', 20, '女', '19912341234', NULL);
INSERT INTO `user` VALUES (10, '张无极', 20, '女', '19912341234', NULL);
INSERT INTO `user` VALUES (11, '张无极', 20, '女', '19912341234', NULL);
INSERT INTO `user` VALUES (32544563758, '王五', 20, '男', '18812341234', '41302512341234123');
INSERT INTO `user` VALUES (32546236374, '李四', 20, '男', '18812341234', '41302512341234123');
INSERT INTO `user` VALUES (147563212344, '张三', 20, '男', '18812341234', '41302512341234123');
COMMIT;

-- ----------------------------
-- Table structure for wallet_details
-- ----------------------------
DROP TABLE IF EXISTS `wallet_details`;
CREATE TABLE `wallet_details` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_name` varchar(10) COLLATE utf8_bin NOT NULL COMMENT '购买用户',
  `order_id` bigint NOT NULL COMMENT '订单号',
  `amount` decimal(10,2) NOT NULL COMMENT '交易金额',
  `describe` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `operator_result` varchar(10) COLLATE utf8_bin DEFAULT '1' COMMENT '操作结果: 1已完成 2已退款',
  `model_name` varchar(10) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='钱包明细表';

-- ----------------------------
-- Table structure for wallets
-- ----------------------------
DROP TABLE IF EXISTS `wallets`;
CREATE TABLE `wallets` (
  `id` bigint NOT NULL,
  `user_id` bigint NOT NULL COMMENT '用户id',
  `bank_id` bigint NOT NULL COMMENT '银行卡id',
  `amount` decimal(10,2) DEFAULT NULL COMMENT '钱包余额',
  `create_time` datetime NOT NULL COMMENT '付款时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='钱包表';

-- ----------------------------
-- Records of wallets
-- ----------------------------
BEGIN;
INSERT INTO `wallets` VALUES (534573135, 147563212344, 41302512341234123, 12245.00, '2023-03-21 13:57:23');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
